import request from '@/config/axios'

export interface VenueVO {
                    typeId: number
                    code: string
                    name: string
                    description: string
                    openedAt: localtime
                    closedAt: localtime
                    price: number
                    status: number
                    id: number
}

// 查询体育场馆列表
export const getVenuePage = async (params) => {
  return await request.get({ url: '/vrs/venue/page', params })
}

// 查询体育场馆详情
export const getVenue = async (id: number) => {
  return await request.get({ url: '/vrs/venue/get?id=' + id })
}

// 新增体育场馆
export const createVenue = async (data: VenueVO) => {
  return await request.post({ url: '/vrs/venue/create', data })
}

// 修改体育场馆
export const updateVenue = async (data: VenueVO) => {
  return await request.put({ url: '/vrs/venue/update', data })
}

// 删除体育场馆
export const deleteVenue = async (id: number) => {
  return await request.delete({ url: '/vrs/venue/delete?id=' + id })
}

// 导出体育场馆 Excel
export const exportVenueApi = async (params) => {
  return await request.download({ url: '/vrs/venue/export-excel', params })
}